<script setup lang="ts">

import Micro_a from "./micro/micro_a.vue";
</script>

<template>
  <div>
    <el-container>
      <el-header>Header</el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
              :uniqueOpened="true"
              class="el-menu-vertical-demo"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
              router
          >
            <el-sub-menu index="1">
              <template #title>
                <i class="el-icon-location"></i>
                <span>导航一</span>
              </template>
              <el-menu-item index="page1">page1</el-menu-item>
              <el-menu-item index="page2">page2</el-menu-item>
              <el-sub-menu >
                <template #title>选项4</template>
                <el-menu-item index="page3">page3</el-menu-item>
              </el-sub-menu>
            </el-sub-menu>
            <el-sub-menu index="2">
              <template #title>
                <i class="el-icon-location"></i>
                <span>导航二</span>
              </template>
              <el-menu-item index="micro1">micro1</el-menu-item>
              <el-menu-item index="micro2">micro2</el-menu-item>
              <el-menu-item index="micro3">micro3</el-menu-item>
            </el-sub-menu>
          </el-menu>
        </el-aside>
        <el-container>
          <el-main>
            <router-view>
              <template #default="{ Component, route }">
                <micro_a v-show="route.meta.isMicroApp"/>
                <component :is="Component" :key="route.fullPath" v-if="!route.meta.isMicroApp"/>
              </template>
            </router-view>
          </el-main>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<style >
.el-header{
  background-color: #b3c0d1;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 60px;
  width: 100%;
}

.el-aside {
  background-color: #d3dce6;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 200px;
  height: calc(100vh - 60px);
}

.el-main {
  background-color: #e9eef3;
  color: var(--el-text-color-primary);
  text-align: center;
}


</style>
